// 二菜单自动展开
var cur_label = $("title").text();
$(".nav-treeview").find("a").each(function () {
    var nav_label = $(this).children("p").text();
    if(cur_label == nav_label){
        $(this).addClass("active");
        $(this).parents('.has-treeview').addClass("menu-open");
        return false;
    }
});

var ajax = $.ajax;
$.extend({
    ajax: function(url, options) {
        if (typeof url === 'object') {
            options = url;
            url = undefined;
        }
        options = options || {};
        url = options.url;
        var xsrftoken = $('meta[name=_xsrf]').attr('content');
        var headers = options.headers || {};
        var domain = document.domain.replace(/\./ig, '\\.');
        if (!/^(http:|https:).*/.test(url) || eval('/^(http:|https:)\\/\\/(.+\\.)*' + domain + '.*/').test(url)) {
            headers = $.extend(headers, {'X-Xsrftoken':xsrftoken});
        }
        options.headers = headers;
        return ajax(url, options);
    }
});

var ace_key_str = "linkbook1qaz*WSX";
function AesEncode(plaintTextStr) {

    var key = CryptoJS.enc.Utf8.parse(ace_key_str);
    var encryptedData = CryptoJS.AES.encrypt(plaintTextStr, key, {
        iv: key,
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs7
    });
    encryptedData = encryptedData.ciphertext.toString();
    return encryptedData
}



//checkbox





